package cn.sang.web;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.sang.model.Teacher;
import cn.sang.service.TeacherService;

@RequestMapping("/normal")
@Controller
public class TeacherController {
	
	@Resource
	private TeacherService teacherService;
	
	/**
	 * 首页教师风云榜
	 */
	@RequestMapping("/indexTeacherList.do")
	@ResponseBody
	public List<Teacher> indexList(HttpServletRequest request){
		List<Teacher> indexList = teacherService.indexTeacherList(request);
		return indexList;
	}
	
	/**
	 * 根据教师id查询信息
	 */
	@RequestMapping("/getTeacherById.do")
	@ResponseBody
	public Teacher getTeacherById(HttpServletRequest request){
		Teacher teacherById = teacherService.getTeacherById(request);
		return teacherById;
	}
	
	
}
